import express from "express";

const router = express.Router();

router.get("/login", (req, res) => {
  res.header("Conten-Type", "application/json");
  res.send({
    code: 200,
    message: "登录成功",
  });
});

router.get("/register", (req, res) => {
  res.header("Conten-Type", "application/json");
  res.send({
    code: 200,
    message: "注册成功",
  });
});

router.get("/info", (req, res) => {
  res.header("Conten-Type", "application/json");
  res.send({
    code: 200,
    data: {
      name: "张三",
      age: 18,
    },
  });
});

router.post("/changeInfo", (req, res) => {
  console.log(req.body);
  res.header("Conten-Type", "application/json");
  res.send({
    code: 200,
    message: "修改成功",
  });
});

export default router;
